﻿<UserControl x:Class="MainGameModule.Views.WallOfFameView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:converters="clr-namespace:MainGameModule.Views.Converters"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data">

    <UserControl.Resources>
        <ResourceDictionary>
        <converters:StringToImageSourceConverter x:Key="StringToImageSourceConverter" />
        <converters:IntToVisibilityConverter x:Key="IntToVisibilityConverter" />
        <converters:IntToVisibilityReverseConverter x:Key="IntToVisibilityReverseConverter" />
        
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/YourWorld.Common;component/Styles/CommonResourcesDictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
        <Grid x:Name="Tutorial"
                Width="750"
              Height="500">
	        <Grid.RowDefinitions>
	        	<RowDefinition Height="Auto" />
				<RowDefinition Height="*" />      
			</Grid.RowDefinitions>

            <Path x:Name="BackgroundRectangle"
                  Grid.RowSpan="2"
                  Data="M187.2383,141.7393C187.2383,141.7393,176.3913,144.7943,172.5713,149.0723C164.2383,158.4063,166.5713,209.7393,165.2383,221.7393C163.9053,233.7393,163.9053,364.4073,165.2383,397.0733C166.5713,429.7393,165.2383,441.7393,167.9053,452.4053C170.5713,463.0733,178.5713,462.4053,187.2383,465.7393C195.9053,469.0733,317.9053,475.0733,335.2383,475.0733C352.5713,475.0733,497.2383,476.4073,523.9053,475.0733C550.5723,473.7393,617.2393,476.4053,630.5723,469.7393C643.9053,463.0733,651.2383,452.4053,651.2383,435.7393C651.2383,419.0733,652.5713,301.0723,651.2383,249.0723C649.9053,197.0723,651.8313,159.3863,645.9053,150.4063C641.9333,144.3863,629.2383,143.7393,617.9053,141.7393C606.5723,139.7393,419.9053,137.7393,381.2383,138.4063C342.5713,139.0723,187.2383,141.7393,187.2383,141.7393z"
                  Stretch="Fill">
                <Path.Effect>
                    <DropShadowEffect Opacity="0.5" />
                </Path.Effect>
                <Path.Fill>
                    <RadialGradientBrush RadiusX="0.8">
                        <GradientStop Color="#FFD1E778" />
                        <GradientStop Color="#FF4A6305"
                                      Offset="1" />
                    </RadialGradientBrush>
                </Path.Fill>
            </Path>

            <Button x:Name="CloseButton"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top"
                    Margin="20"
                    Style="{StaticResource CloseButtonStyle}"
                    Command="{Binding CloseWallOfFameCommand}" />

        <TextBlock Margin="20"
                   FontFamily="Segoa UI"
                   FontSize="35"
                   Foreground="White"
                   FontWeight="ExtraBold"
                   Text="WALL OF FAME"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center" />

        <ScrollViewer BorderThickness="0"
                          Style="{StaticResource ListBoxScrollViewerStyle}"
                          ScrollViewer.VerticalScrollBarVisibility="Visible"
                          Grid.Row="1"
                          Margin="20 20 20 30"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Top"
                          ScrollViewer.HorizontalScrollBarVisibility="Disabled">

                <ListBox x:Name="PlayersList"
                         Background="Transparent"
                         BorderBrush="Transparent"
                         ItemsSource="{Binding Players}"
                     ItemContainerStyle="{StaticResource NoSelectionListBoxItemWOF}">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical" />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Border Width="100"
                                        Height="100"
                                        Margin="5 5 20 5"
                                        CornerRadius="10">
                                    <Image Source="{Binding Image, Converter={StaticResource StringToImageSourceConverter}}"
                                           Stretch="Uniform" />
                                </Border>

                                <Grid Grid.Column="1">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>

                                    <StackPanel Grid.Row="0"
                                                Margin="0"
                                                Orientation="Horizontal">
                                        <TextBlock Text="Name: "
                                                   Foreground="White"
                                                   VerticalAlignment="Center"
                                                   FontSize="12"
                                                   FontFamily="Segoe UI" />
                                        <TextBlock Text="{Binding Name}"
                                                   Foreground="White"
                                                   FontSize="18"
                                                   FontFamily="Segoe UI" />
                                    </StackPanel>

                                    <StackPanel Grid.Row="1"
                                                Margin="0"
                                                Orientation="Horizontal">
                                        <TextBlock Text="Experience: "
                                                   Foreground="White"
                                                   FontSize="12"
                                                   FontFamily="Segoe UI" />
                                        <ProgressBar Foreground="#FF46FF00"
                                                     Background="Red"
                                                     Value="{Binding RationedExperience}"
                                                     Maximum="1"
                                                     Width="250"
                                                     Height="8"
                                                     BorderBrush="{x:Null}" />
                                    </StackPanel>

                                    <StackPanel Grid.Row="2" Margin="0" 
                                                Orientation="Horizontal">
                                        <TextBlock Text="Level: "
                                                   Foreground="White"
                                                   VerticalAlignment="Center"
                                                   FontSize="12"
                                                   FontFamily="Segoe UI" />
                                        <ListBox ItemsSource="{Binding GameLevelCollectionWorkaround}"
                                                 Background="Transparent" Margin="0" Padding="0"
                                                 BorderBrush="Transparent"
                                             ItemContainerStyle="{StaticResource NoSelectionListBoxItemWOF}">
                                            <ListBox.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <StackPanel Orientation="Horizontal" />
                                                </ItemsPanelTemplate>
                                            </ListBox.ItemsPanel>
                                            <ListBox.ItemTemplate>
                                                <DataTemplate>
                                                    <Image Source="images/game_level_medal.png"
                                                           Height="20"
                                                           Width="20" />
                                                </DataTemplate>
                                            </ListBox.ItemTemplate>
                                        </ListBox>
                                    </StackPanel>

                                    <StackPanel Grid.Row="3"
                                            Margin="0"
                                            Orientation="Horizontal">
                                        <TextBlock Text="Badges: "
                                                   VerticalAlignment="Center"
                                                   Foreground="White"
                                                   FontSize="12"
                                                   FontFamily="Segoe UI" />
                                        <Grid>
                                            <TextBlock Text="No items."
                                                       HorizontalAlignment="Left"
                                                       VerticalAlignment="Center"
                                                       Foreground="White"
                                                       Visibility="{Binding BadgesCollection.Count, Converter={StaticResource IntToVisibilityReverseConverter}}"
                                                       FontSize="14"
                                                       FontFamily="Segoe UI" />
                                        <ScrollViewer Width="450"
                                                      Margin="0"
                                                      Padding="0"
                                                      Visibility="{Binding BadgesCollection.Count, Converter={StaticResource IntToVisibilityConverter}}"
                                                          BorderBrush="Transparent"
                                                          Style="{StaticResource ListBoxScrollViewerStyle2}">
                                                <ListBox ItemsSource="{Binding BadgesCollection}"
                                                         Background="Transparent"
                                                     BorderBrush="Transparent"
                                                     Margin="0"
                                                     Padding="0"
                                                     ItemContainerStyle="{StaticResource NoSelectionListBoxItemWOF}">
                                                    <ListBox.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <StackPanel Orientation="Horizontal"
                                                                        ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                                                        ScrollViewer.HorizontalScrollBarVisibility="Auto" />
                                                        </ItemsPanelTemplate>
                                                    </ListBox.ItemsPanel>
                                                    <ListBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <Image Source="{Binding Image}"
                                                                   Height="40"
                                                                   Width="40"
                                                               ToolTipService.ToolTip="{Binding Title}" />
                                                        </DataTemplate>
                                                    </ListBox.ItemTemplate>
                                                </ListBox>
                                            </ScrollViewer>
                                        </Grid>
                                    </StackPanel>

                                    <StackPanel Grid.Row="4"
                                            Margin="0"
                                            Orientation="Horizontal">
                                        <TextBlock Text="Quests: "
                                                   VerticalAlignment="Center"
                                                   Foreground="White"
                                                   FontSize="12"
                                                   FontFamily="Segoe UI" />
                                        <Grid>
                                            <TextBlock Text="No items."
                                                       HorizontalAlignment="Left"
                                                       VerticalAlignment="Center"
                                                       Foreground="White"
                                                       Visibility="{Binding QuestsCollection.Count, Converter={StaticResource IntToVisibilityReverseConverter}}"
                                                       FontSize="14"
                                                       FontFamily="Segoe UI" />
                                        <ScrollViewer Width="450"
                                                      Margin="0"
                                                      Padding="0"
                                                      BorderBrush="Transparent"
                                                          Visibility="{Binding QuestsCollection.Count, Converter={StaticResource IntToVisibilityConverter}}"
                                                          Style="{StaticResource ListBoxScrollViewerStyle2}">
                                                <ListBox ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                                         ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                                         ItemsSource="{Binding QuestsCollection}"
                                                         Background="Transparent"
                                                     BorderBrush="Transparent"
                                                     Margin="0"
                                                     Padding="0"
                                                     ItemContainerStyle="{StaticResource NoSelectionListBoxItemWOF}">
                                                    <ListBox.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <StackPanel Orientation="Horizontal"
                                                                        ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                                                        ScrollViewer.HorizontalScrollBarVisibility="Hidden" />
                                                        </ItemsPanelTemplate>
                                                    </ListBox.ItemsPanel>
                                                    <ListBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <Image Source="{Binding Image}"
                                                                   Height="40"
                                                                   Width="40"
                                                               ToolTipService.ToolTip="{Binding Title}" />
                                                        </DataTemplate>
                                                    </ListBox.ItemTemplate>
                                                </ListBox>
                                            </ScrollViewer>
                                        </Grid>
                                    </StackPanel>

                                    <Rectangle Fill="#FF4A6305"
                                               Grid.Row="5"
                                               Height="2"
                                               HorizontalAlignment="Left"
                                               Width="450"
                                               Margin="10 5 0 5" />
                                    
                                </Grid>
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </ScrollViewer>
        </Grid>
</UserControl>
